<?php
require ('../../ht/Common/dbConn.php');
//连接数据库
connect();
//获取表单数据
$uname=$_POST["uname"];
$password=$_POST["password"];
//编写sql语句并执行
$sql="select * from users where uname='$uname' and password='$password'";
$rs=mysql_query($sql);
$num=mysql_num_rows($rs);
if($num>0) //登录成功，将当前用户的用户名写入session存储
{
    session_start();
    $_SESSION["user"]=$uname;
    header("location:../qt_index.php");
}
else{
    echo "登录失败，1秒后返回登录页重新登录";
    header("refresh:1;url='../qt_login/qt_login.php'");
}
?>
